<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BUIOperation
 *
 * @author ID59C
 */
class BUIOperation extends BUINode {

    public function __construct($node = NULL) {
        parent::__construct($node);
        $this->operation = $node;
    }

    public function render($data = null) {
        $opp = $this->getActiveOperation();
        $app = $this->getActiveServiceApp();

        if ($opp != NULL && $app != NULL) {
            $uiApp = $app->getUIManager();
            $uiApp->setActiveService($this->getActiveService());
            $uiApp->renderOperation($opp, $data);
        }

        return FALSE;
    }

    public function getUrl($data = NULL) {
        return $this->buildUrl($this->service->getId(), $this->sApp->getId(), $this->operation->getId(), $data);
    }

    public function getStartScreen() {
        $operationData = $this->getActiveOperation()->getConfig();

        $screen = isset($operationData['screen']) ? $operationData['screen'] : FALSE;

        return $screen;
    }

    public function getStartScreenFlow() {
        $operationData = $this->getActiveOperation()->getConfig();

        $screenFlow = isset($operationData['screenflow']) ? $operationData['screenflow'] : FALSE;

        return $screenFlow;
    }

}

?>
